<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script src="../js/vue.js"></script>
<div id="app">
<!---->
<!--  <input type="checkbox" value="篮球" v-model="hobbies">篮球-->
<!--  <input type="checkbox" value="足球" v-model="hobbies">足球-->
<!--  <input type="checkbox" value="网球" v-model="hobbies">网球-->
<!--  <input type="checkbox" value="橄榄球" v-model="hobbies">橄榄球-->
<!--上面这种是值写死的，但是有时候我们想从服务器动态获取数据，就不能这样写了-->
  <label v-for="item in getHobbies" :for="item">
    <input type="checkbox" :id="item" :value="item" v-model="hobbies">{{item}}
  </label>
  <h2>您的爱好是:{{hobbies}}</h2>
</div>
<script>
  const app = new Vue({
    el:'#app',
    data:{
      message:'hello vue',
      isAgree:false,
      hobbies:[],
      getHobbies:['篮球','足球','网球','橄榄球']
    }

  })
</script>

</body>
</html>